<template>
  <a-row justify="center" align="center" style="padding: 0 5%">
    <a-form ref="formRef" :model="form" auto-label-width class="w-full">
      <a-form-item label="文件名称" field="name" :rules="[{ required: true, message: '请输入文件名称' }]" style="margin-bottom: 0">
        <a-input v-model="form.name" placeholder="请输入文件名称" allow-clear @change="handleChange" />
      </a-form-item>
    </a-form>
  </a-row>
</template>

<script lang="ts" setup>
import { reactive } from 'vue'
const formRef = useTemplateRef('formRef')
const form = reactive({
  fileId: '',
  name: ''
})

const setForm = (obj: { fileId: string, name: string }) => {
  if(!form?.fileId){
    Object.assign(form, obj)
  }
}



const getForm = () => {
  return form
}

defineExpose({ formRef, setForm, getForm })
</script>

<style lang="scss" scoped></style>
